/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "hos_mot_ref")
@NamedQueries({
    @NamedQuery(name = "HosMotRef.findAll", query = "SELECT h FROM HosMotRef h")})
public class HosMotRef implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "hrm_id")
    private Integer hrmId;
    @Size(max = 2147483647)
    @Column(name = "hrm_otros")
    private String hrmOtros;
    @JoinColumn(name = "hrc_id", referencedColumnName = "hrc_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private HosReferenciaContrareferencia hosReferenciaContrareferencia;
    @JoinColumn(name = "hmr_id", referencedColumnName = "hmr_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private HosMotivoReferencia hosMotivoReferencia;

    public HosMotRef() {
    }

    public HosMotRef(Integer hrmId) {
        this.hrmId = hrmId;
    }

    public Integer getHrmId() {
        return hrmId;
    }

    public void setHrmId(Integer hrmId) {
        this.hrmId = hrmId;
    }

    public String getHrmOtros() {
        return hrmOtros;
    }

    public void setHrmOtros(String hrmOtros) {
        this.hrmOtros = hrmOtros;
    }

    public HosReferenciaContrareferencia getHosReferenciaContrareferencia() {
        return hosReferenciaContrareferencia;
    }

    public void setHosReferenciaContrareferencia(HosReferenciaContrareferencia hosReferenciaContrareferencia) {
        this.hosReferenciaContrareferencia = hosReferenciaContrareferencia;
    }

    public HosMotivoReferencia getHosMotivoReferencia() {
        return hosMotivoReferencia;
    }

    public void setHosMotivoReferencia(HosMotivoReferencia hosMotivoReferencia) {
        this.hosMotivoReferencia = hosMotivoReferencia;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hrmId != null ? hrmId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HosMotRef)) {
            return false;
        }
        HosMotRef other = (HosMotRef) object;
        if ((this.hrmId == null && other.hrmId != null) || (this.hrmId != null && !this.hrmId.equals(other.hrmId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.HosMotRef[ hrmId=" + hrmId + " ]";
    }
    
}
